package guoanmaker.operator.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import guoanmaker.operator.business.service.OperatorNewsListServiceInterface;
import guoanmaker.operator.business.service.OperatoroOficialSeviceInterface;
import guoanmaker.operator.helper.common.AjaxJson;
import guoanmaker.operator.helper.common.abstractobj.ApiController;
import io.swagger.annotations.ApiOperation;
/**
 * 官网接口
* @ClassName: OperatoroOficialController
* @Description:TODO (这里用一句话描述这个类的作用) 
* @author lihongyu
* @date 2017年8月31日 上午11:29:50 
*  
 */
@RestController
@RequestMapping(ApiController.OPERATOR_PC_OFICIAL)
public class OperatoroPCoficialController {
	@Autowired
	private OperatoroOficialSeviceInterface operatoroOficialSeviceInterface;
	@Autowired
	private OperatorNewsListServiceInterface operatorNewsListServiceInterface;
	 @ApiOperation(value = "官网接口", notes = "官网接口")
	    @RequestMapping(value = "/getAllPc", method = RequestMethod.POST)
	    public AjaxJson getAllPc(String cityId){
		 AjaxJson ajaxJson=new AjaxJson();
	        return ajaxJson.setSuccess(true).setStatus(200).setData(operatoroOficialSeviceInterface.getAllpc(cityId));
	    }
	 @ApiOperation(value = "官网服务列表", notes = "官网服务列表")
	    @RequestMapping(value = "/getServerClassBypcNavigation", method = RequestMethod.POST)
	 public AjaxJson getServerClassBypcNavigation(String pcNavigation){
		 AjaxJson ajaxJson=new AjaxJson();
		 try{
		 ajaxJson.setSuccess(true).setStatus(200).setData(operatoroOficialSeviceInterface.selectOperatorServerClassList(pcNavigation));
		 }catch(Exception e){
			 e.printStackTrace();
			 ajaxJson.setSuccess(false).setStatus(250).setData(null);
			 
		 }
		 return ajaxJson;
	 }
	 
	 
	 @ApiOperation(value = "官网全部一级列表二级三级", notes = "官网全部一级列表二级三级")
	    @RequestMapping(value = "/getServerClassList", method = RequestMethod.POST)
	 public AjaxJson getServerClassList(){
		 AjaxJson ajaxJson=new AjaxJson();
		 try{
		 ajaxJson.setSuccess(true).setStatus(200).setData(operatoroOficialSeviceInterface.selectOperatorServerClassListNoPra());
		 }catch(Exception e){
			 e.printStackTrace();
			 ajaxJson.setSuccess(false).setStatus(250).setData(null);
			 
		 }
		 return ajaxJson;
	 }
	 @ApiOperation(value = "获取导航栏", notes = "获取导航栏")
	 @RequestMapping(value = "/getNavigation", method = RequestMethod.POST)
	 public AjaxJson getNavigation(String cityId) {
		 AjaxJson ajaxJson=new AjaxJson();
		 try {
			ajaxJson.setSuccess(true).setStatus(200).setData(operatoroOficialSeviceInterface.getNavigation(cityId)).setMsg("操作成功");
		} catch (Exception e) {
			ajaxJson.setSuccess(false).setStatus(500).setData(null).setMsg("服务器异常");
			e.printStackTrace();
		}
		 return ajaxJson;
	 }
	 
	 @ApiOperation(value = "获取服务内容", notes = "获取服务内容")
	 @RequestMapping(value = "/getService", method = RequestMethod.POST)
	 public AjaxJson getService(String cityId) {
		 AjaxJson ajaxJson=new AjaxJson();
		 try {
			 ajaxJson.setSuccess(true).setStatus(200).setData(operatoroOficialSeviceInterface.getService(cityId)).setMsg("操作成功");
		} catch (Exception e) {
			ajaxJson.setSuccess(false).setStatus(500).setData(null).setMsg("服务器异常");
			e.printStackTrace();
		}
		 return ajaxJson;
	 }
	 
	 @ApiOperation(value = "改写官网接口", notes = "改写官网接口")
	 @RequestMapping(value = "/getPc", method = RequestMethod.POST)
	 public AjaxJson getPc(String cityId) {
		 AjaxJson ajaxJson=new AjaxJson();
		 try {
			 ajaxJson.setSuccess(true).setStatus(200).setData(operatoroOficialSeviceInterface.getPc(cityId)).setMsg("操作成功");
		} catch (Exception e) {
			ajaxJson.setSuccess(false).setStatus(500).setData(null).setMsg("服务器异常");
			e.printStackTrace();
		}
		 return ajaxJson;
	 }
	 
}
